    <?php 
    $attributes = array('id' => 'add_form_op');
    echo form_open('output/saveoutput/' . $idBusinessLine . '/' . $idOutcome, $attributes); ?>
    <table width="100%">
    	<tr>
        	<td class="menuActual">Config > Data > Add Output</td>
        </tr>
        <tr>
        	<td>
                <span id='output_form_msg' class="msg_error">* Required fields</span>
            	<table>
    			<?php
                if(!isset($output)) $output = new Output_dto();
                echo form_hidden('idOP', $output->id);
                ?>
                  <tr>
                    <td class="descripcionForm"> <?php	echo form_label("Name: *");?>    </td>
                    <td class="descripcionForm">
                        <?php
    					$attributes = array('id' => 'nameOP', 'rows' => '3', 'cols' => '50','name' => 'nameOP', 'maxlength' => '250', 
    					'value' => (set_value('nameOP') == '' ? $output->name : set_value('nameOP')));
    					echo form_textarea($attributes);
                        ?>
                    </td>
                  </tr>
                  
                  <tr>
                    <td class="descripcionForm"><?php echo form_label("Outcome: *"); ?></td>
                    <td class="descripcionForm">
                        <?php
    					$opcionesOC = array();
                        if(isset($outcomes)){
    						$defaultSelection = $output->idOutcome;
    						foreach ($outcomes as $outc) {
    							$nombreOC_cortado = strlen($outc->name) > 50 ? substr($outc->name, 0, 50) . ' (...)' : $outc->name;
                                $opcionesOC[$outc->id] = $nombreOC_cortado;
    							if($defaultSelection == 0) $defaultSelection = $outc->id;
    						}
    					
    						echo form_dropdown('outcome_op', $opcionesOC, $defaultSelection, 'id = outcome_op');
    					}
                        ?>                
                    </td>
                  </tr>
                  <tr>
                        <td class="descripcionForm" colspan="2"><?php echo validation_errors(); ?></td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <?php echo form_close();?>